package main

import (
	"gitee.com/code_batcher/avatar/internal/apps/shell"
	"gitee.com/code_batcher/avatar/internal/apps/user"
	"gitee.com/code_batcher/avatar/internal/middlerwares"
	"github.com/gofiber/fiber/v3"
	"github.com/gofiber/fiber/v3/middleware/recover"
)

func main() {
	app := fiber.New()

	app.Use(recover.New(recover.Config{EnableStackTrace: true}))
	v1 := app.Group("/api/v1")

	userApi := v1.Group("/user")
	userApi.Post("/login", user.Login)

	sshApi := v1.Group("/shell")
	sshApi.Use(middlerwares.Auth)
	sshApi.Post("/exec", shell.Exec)
	sshApi.Post("/script", shell.Script)

	_ = app.Listen(":9009")
}
